import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
//引入插件
import AutoImport from 'unplugin-auto-import/vite';
import path from 'path'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    //配置插件
  	AutoImport({
  		imports:['vue','vue-router'],
      resolvers: [ElementPlusResolver()],
  	}),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
  ],
  resolve: {
    // 配置路径别名
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  server:{
		proxy:{
			// '/api':'http://192.168.0.102:8080/BookMall'  // WIFI贼
      // '/api':'http://192.168.211.251:8080/BookMall'  // 李泓勃
      '/api': 'http://localhost:8080/BookMall'          // 本地服务
      // '/api': 'http://192.168.43.49:8080/BookMall'    // Eternity
		}
	}
})
